﻿@using Gx.Model.ViewModel;
@model LKWarehouseEntryDto
@{
    ViewBag.Title = "包仓入库单打印";
    Layout = "~/Views/Shared/PrintMaste.cshtml";
}

<div id="PrintContent">
    <!--begin-->
    <table class="gridtable">
        <thead>
            <tr>
                <th colspan="19" style="font-weight: bold; border: 1px solid #e8e8e8;">亳州市中昆供应链管理服务有限公司</th>
            </tr>
            <tr>
                <th colspan="19" style="font-weight:bold;border: 1px solid black;">包仓入库单</th>
            </tr>
            <tr>
                <td colspan="2" style="border: 1px solid black;">单据编号：</td>
                <td colspan="2" style="border: 1px solid black;">@Model.WarehouseEntry.BillNo</td>


                <td colspan="3" style="border: 1px solid black;">入库时间：</td>
                <td colspan="4" style="border: 1px solid black;">@Model.WarehouseEntry.EntryTime.ToString("yyyy-MM-dd")</td>


                <td colspan="2" style="border: 1px solid black;">车牌号:</td>
                <td colspan="6" style="border: 1px solid black;">@Model.WarehouseEntry.CarNumber</td>

            </tr>
            <tr>
                <td colspan="2" style="border: 1px solid black;">客户名称：</td>
                <td colspan="2" style="border: 1px solid black;"> @Model.WarehouseEntry.CustomerName</td>



                <td colspan="3" style="border: 1px solid black;">合同编号：</td>
                <td colspan="4" style="border: 1px solid black;">@Model.WarehouseEntry.ContractNo</td>

                <td colspan="2" style="border: 1px solid black;">合同类型:</td>
                <td colspan="6" style="border: 1px solid black;">@Model.WarehouseEntry.RentalWarehouseTypeName</td>


                @*<td colspan="2" style="border: 1px solid black;">汇率：</td>
            @{

                string StrExchangeRate = so.ExchangeRate == 0 ? "" : so.ExchangeRate.ToString("f4");
            }
            <td colspan="6" style="border: 1px solid black;">@StrExchangeRate</td>*@
            </tr>
            <tr>
                <td colspan="2" style="border: 1px solid black;">开始时间：</td>
                <td colspan="2" style="border: 1px solid black;">@Model.WarehouseEntry.BeginTime.ToString("yyyy-MM-dd")</td>


                <td colspan="3" style="border: 1px solid black;">结束时间：</td>
                <td colspan="4" style="border: 1px solid black;">@Model.WarehouseEntry.EndTime.ToString("yyyy-MM-dd")</td>



                <td colspan="2" style="border: 1px solid black;">周期：</td>
                <td colspan="6" style="border: 1px solid black;">@Model.WarehouseEntry.Cycle</td>
            </tr>

            <tr>
                <td colspan="2" style="border: 1px solid black;">包仓类型：</td>
                @{
                    string chargingUnitName = string.Empty;
                    switch (Model.WarehouseEntry.ChargingUnit)
                    {
                        case 1:
                            chargingUnitName = "包面积";
                            break;
                        case 2:
                            chargingUnitName = "包卡位";
                            break;
                        default:
                            chargingUnitName = "";
                            break;
                    }
                }
                <td colspan="2" style="border: 1px solid black;">@chargingUnitName</td>
                <td colspan="3" style="border: 1px solid black;">包仓算法：</td>
                @{
                    string coldAlgorithmName = string.Empty;
                    switch (Model.WarehouseEntry.ColdAlgorithm)
                    {
                        case 1:
                            coldAlgorithmName = "按自然月计算";
                            break;
                        case 2:
                            coldAlgorithmName = "按计费月计算";
                            break;
                        case 3:
                            coldAlgorithmName = "按自然天计算";
                            break;
                        default:
                            coldAlgorithmName = "";
                            break;
                    }
                }
                <td colspan="4" style="border: 1px solid black;">@coldAlgorithmName</td>

                <td colspan="2" style="border: 1px solid black;">单价：</td>
                <td colspan="6" style="border: 1px solid black;">@Model.WarehouseEntry.ColdUnitPrice</td>
            </tr>
            <tr>
                <td colspan="2" style="border: 1px solid black;">总吨重：</td>
                <td colspan="2" style="border: 1px solid black;">@Model.WarehouseEntry.TotalTon</td>
                <td colspan="3" style="border: 1px solid black;">总件数：</td>
                <td colspan="4" style="border: 1px solid black;">@Model.WarehouseEntry.Total</td>

                <td colspan="2" style="border: 1px solid black;">总金额：</td>
                <td colspan="6" style="border: 1px solid black;">@Model.WarehouseEntry.Amount</td>
            </tr>
            <tr>


                <td colspan="2" style="border: 1px solid black;">备注：</td>
                <td colspan="14" style="border: 1px solid black;">@Model.WarehouseEntry.Remark</td>

            </tr>

            <tr>

                <td colspan="19" style="border-left: 1px solid black; border-right: 1px solid black "></td>
            </tr>

            <tr>
                <td>行号</td>
                <td>商品批号</td>
                <td>商品</td>
                <td>规格</td>
                <td>仓位</td>
                <td>单件重量</td>
                <td>单件数量</td>
                <td>面积</td>
                <td>每板件数</td>
                <td>总吨重</td>
                <td>板数</td>
                <td>生产日期</td>
                <td>保质日期</td>
                <td>产地</td>
                <td>已处理</td>
                <td>备注</td>


            </tr>

            @{
                int index = 1;
            }
            @foreach (var item in Model.Details)
            {
                <tr>
                    <td>@index</td>
                    <td>@item.GoodsNo</td>
                    <td>@item.GoodsName</td>
                    <td>@item.GoodsSpecName</td>
                    <td>@item.WareHouseName</td>
                    <td>@item.Weight</td>
                    <td>@item.Number</td>
                    <td>@item.Area</td>
                    <td>@item.AvNumber</td>
                    <td>@item.TonWeight</td>
                    <td>@item.PlateNumber</td>
                    @if (item.ProductionDate.Year == 1911)
                    {
                        <td></td>
                    }
                    else
                    {
                        <td>@item.ProductionDate.ToString("yyyy-MM-dd")</td>
                    }
                    @if (item.ExpirationDate.Year == 1911)
                    {
                        <td></td>
                    }
                    else
                    {
                        <td>@item.ExpirationDate.ToString("yyyy-MM-dd")</td>
                    }

                    <td>@item.ProducingArea</td>
                    @{
                        string Processed = item.Processed ? "是" : "否";
                    }
                    <td>@Processed</td>
                    <td colspan="5">@item.Remark</td>

                </tr>
                index++;
            }
            <tr>

                <td colspan="20" style="border: 1px solid #e8e8e8;"></td>
            </tr>
            <tr>
                <td colspan="2" style="border: 1px solid #e8e8e8;">制单人</td>
                <td colspan="2" style="border: 1px solid #e8e8e8;"></td>
                <td style="border: 1px solid #e8e8e8;">制单日期</td>
                <td colspan="2" style="border: 1px solid #e8e8e8;"></td>
                <td colspan="2" style="border: 1px solid #e8e8e8;">修改人</td>
                <td colspan="2" style="border: 1px solid #e8e8e8;"></td>
                <td colspan="2" style="border: 1px solid #e8e8e8;">修改日期</td>
                <td colspan="3" style="border: 1px solid #e8e8e8;"></td>
            </tr>
            <tr>
                <td colspan="2" style="border: 1px solid #e8e8e8;">@Model.WarehouseEntry.CreateUser</td>
                <td colspan="2" style="border: 1px solid #e8e8e8;"></td>
                <td style="border: 1px solid #e8e8e8;">@Model.WarehouseEntry.CreateTime.ToString("yyyy-MM-dd")</td>
                <td colspan="2" style="border: 1px solid #e8e8e8;"></td>
                <td colspan="2" style="border: 1px solid #e8e8e8;">@Model.WarehouseEntry.ModifyUser</td>
                <td colspan="2" style="border: 1px solid #e8e8e8;"></td>
                @if (Model.WarehouseEntry.ModifyTime.Year == 1911)
                {
                    <td colspan="2" style="border: 1px solid #e8e8e8;"></td>
                }
                else
                {
                    <td colspan="2" style="border: 1px solid #e8e8e8;">@Model.WarehouseEntry.ModifyTime.ToString("yyyy-MM-dd")</td>
                }

                <td colspan="3" style="border: 1px solid #e8e8e8;"></td>


            </tr>
        </thead>
    </table>
    <!--end-->
</div>

